<%--
<!------------------------------------------------------------------------------
 - Copyright 2005 CORE Solutions Limited
 - All rights reserved.
 - PROPRIETARY AND CONFIDENTIAL INFORMATION.
 - Use is subject to license terms.
 -
 - FUNCTION ID      :   TASK
 - AUTHOR           :   Ric Yik
 - DATE CREATE      :   2005/12/29
 - DESCRIPTION      :   a MAINTENANCE CONTENT JSP file for the function, TASK
 -                  :
 -                  :
 -                  :
 -
 - MODIFICATION HISTORY:
 - DATE         AUTHOR          VERSION NO.         COMMENT
 - -----------  --------------  ------------------  -------------------
 - 2005/12/29   Ric Yik         1.0                 source is generated.
 -
 -
 -
------------------------------------------------------------------------------->

--%>
<%@ include file="/jsp/com/erp/app/common/jsp/directives_include.jsp"%>

<%@ page import="com.erp.app.setup.taskMaster.vo.TaskHdrVo"%>
<%@ page import="com.erp.app.setup.taskMaster.web.TaskMaintenanceAction"%>
<%@ page import="com.erp.app.util.web.TabInfo"%>

<%@ include file="/jsp/com/erp/app/common/jsp/html_include.jsp"%>

<jsp:useBean id="taskMaintenanceForm" scope="session" type="com.erp.app.setup.taskMaster.web.TaskMaintenanceForm" />

<script language="javascript">

	function doLoad() {
		<%
		if (CommonUtil.nullToString((String)session.getAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE)).equals(ProjectConstants.GENERIC_YES)) {
			session.removeAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE);
			out.println("alert('Records saved.');");
		}

		String lastAction = CommonUtil.nullToString(taskMaintenanceForm.getPageEvent());
		if (lastAction.startsWith("pEdit")) {
			out.println(WebUtil.openRemarkTextDo());
		}
		%>
	}

</script>

<body onLoad="javascript:doLoad();">
<html:form action="/taskMaintenance">

<html:hidden property="pageEvent"/>
<html:hidden property="pageMode"/>
<html:hidden property="deleteIdx"/>
<html:hidden property="pageEventSrc"/>

<table class="table_button">

<tr>
	<td>
		<chtml:button form="taskMaintenanceForm" pageEvent="<%=TaskMaintenanceAction.ACTION_EXIT%>"
			styleClass="button1"/>
		<chtml:button form="taskMaintenanceForm" pageEvent="<%=TaskMaintenanceAction.ACTION_SEARCH%>"
			styleClass="button1"/>
		<chtml:button form="taskMaintenanceForm" pageEvent="<%=TaskMaintenanceAction.ACTION_SAVE%>"
			styleClass="button1"/>
		<chtml:button form="taskMaintenanceForm" pageEvent="<%=TaskMaintenanceAction.ACTION_REFRESH%>"
			styleClass="button1"/>
	</td>
</tr>

</table>

<font color='red'><html:errors /></font>

<div id="tabsF"><ul><%

TableSchema ts = taskMaintenanceForm.getTs();

TabInfo[] tabInfos = new TabInfo[] {
	new TabInfo()
		.setFolderIdx(TaskMaintenanceAction.TAB_IDX_HDR)
		.setPageEvent(TaskMaintenanceAction.ACTION_CHANGE_FOLDER_HDR)
		.setTitle(ts.getDisplayWebLabelByObjectId("LBL_TAB_HDR"))
		.setHidden(false)
		.setTabJsp("TaskHdrTab.jsp"),
	new TabInfo()
		.setFolderIdx(TaskMaintenanceAction.TAB_IDX_DTL)
		.setPageEvent(TaskMaintenanceAction.ACTION_CHANGE_FOLDER_DTL)
		.setTitle(ts.getDisplayWebLabelByObjectId("LBL_TAB_DTL"))
		.setHidden(true)
		.setTabJsp("TaskDtlTab.jsp")
};

TabInfo currentTab = null;
for (int i = 0; i < tabInfos.length; ++i) {
	if (taskMaintenanceForm.getFolderIdx().equals(String.valueOf(tabInfos[i].getPageEventSrc()))) {
		currentTab = tabInfos[i];
	}
	if (tabInfos[i].isHidden()) continue;
	%><chtml:button useExtensions="true" uiType="tab" form="taskMaintenanceForm" pageEvent="<%=tabInfos[i].getPageEvent()%>" pageEventSrc="<%=tabInfos[i].getPageEventSrc()%>" /><%
}

%></ul></div><%
%><div class="titlebar"><span class="headertitletext"><%=currentTab.getTitle()%></span></div>
<jsp:include page="<%=tabInfos[0].getTabJsp()%>" flush="true"/>
<jsp:include page="<%=tabInfos[1].getTabJsp()%>" flush="true"/>
</html:form>
